import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Demo1 {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        Executors.newSingleThreadExecutor();
        Executors.newCachedThreadPool();
        for (int i = 0; i < 50; i++) {
            int id=i;
            executorService.submit(() -> {
                System.out.println(Thread.currentThread().getName() + " is running"+id);
            });
        }
        executorService.shutdown();
    }
}
